Unify search across sub-sites - #1093
Conversation
Otherwise, this happens:
$ pixi install
Error: × Failed to update PyPI packages for environment 'default'
├─▶ Failed to prepare distributions
├─▶ Failed to build `pyproj==3.7.2`
├─▶ The build backend returned an error
╰─▶ Call to `setuptools.build_meta.build_wheel` failed (exit status: 1)
[stderr]
proj executable not found. Please set the PROJ_DIR variable. For more
information see: https://pyproj4.github.io/pyproj/stable/installation.html
hint: This usually indicates a problem with the package or the build
environment.
The pixi.lock pins the macOS baseline for osx-arm64 to __osx=13.0
(line 12). pyproj 3.7.2 only ships an arm64 macOS wheel tagged
macosx_14_0_arm64 — no wheel exists for anything below macOS 14.0.
Since the locked environment's floor (13.0) is below what that wheel
declares as its minimum, uv/pixi considers it incompatible and falls
back to the sdist, which then needs the system PROJ library to compile
against — hence "proj executable not found." rasterio 1.5.0 (also
flagged as "installing from remote, not cached" in the verbose log) is
very likely hitting the identical issue for the same reason. Both are
transitive deps of geopandas/contextily, which the docs deps pull in.
Sphinx's built-in search only covers this site's own pages, so napari.org/workshops (a separately-built mystmd site) was invisible to search here and vice versa. Build a Pagefind index alongside the existing Sphinx build and mount a small widget that merges in the workshops site's Pagefind index at query time, since both are served under the same napari.org origin.
|
@aganders3 maybe you can take a look at the code for review? :) |
|
Hi all, I don't quite understand why we would want to have this "hard dependency" on the workshops to build the main docs. I am probably missing something but ideally we would only need the index of the workshops and keep all the implementation (javascript, css, search button etc) here in the napari docs repo. Is that possible? |
@melissawm The only reference to the workshops is for Pagefind's index merging feature: The docs here continue to build independently of the napari workshops content; it's just that the client-side javascript tries to grab the search index at the Does that answer your question? |
|
I see! So this would only be a hard requirement for the first time, because the search index on the napari-workshops side is still not set up, correct? In that case, I'm fine with merging this and iterating if we see opportunity for improvement. I have briefly looked at the CSS and javascript and (not being an expert) it all looks fine to me, so I'll approve! |
This PR is in response to an issue discussed on the napari Zulip. For convenience, here is the relevant summary:
This PR addresses the issue by switching to Pagefind, a static client-side search capable of aggregating across multiple indices. It's the perfect (and only, as far as I am aware 😅) solution to the fragmentation of search between sub-sites of documentation.
This is a first cut that works in my local testing (on macOS) between
docsandworkshops. For it to fully work, the companion PR for napari/workshops#69 must also be merged.Here is a screenshot of the docs search seeing content from workshops:
When the page is wider, the search bar moves to the right instead of centered, along with the search results. A remaining issue is that the new Pagefind-based search results panel is not centered and enlarged like the current docs search—hopefully some additional styling can fix that.